package simulateOS.entity;

import java.util.ArrayList;
import java.util.List;

public class Path {
    private String pathName;
    private Path parent;
    private List<Path> children;

    public Path(String pathName, Path parent) {
        this.pathName = pathName;
        this.parent = parent;
        this.children = new ArrayList();
    }

    public String getPathName() {
        return this.pathName;
    }

    public void setPathName(String pathName) {
        this.pathName = pathName;
    }

    public Path getParent() {
        return this.parent;
    }

    public void setParent(Path parent) {
        this.parent = parent;
    }

    public boolean hasParent() {
        return this.parent != null;
    }

    public List<Path> getChildren() {
        return this.children;
    }

    public void setChildren(List<Path> children) {
        this.children = children;
    }

    public void addChildren(Path child) {
        this.children.add(child);
    }

    public void removeChildren(Path child) {
        this.children.remove(child);
    }

    public boolean hasChild() {
        return !this.children.isEmpty();
    }
}
